using System.Collections.Generic;

namespace Aurora.TaskScheduler.Dashboard;

public class DashboardResult
{
    public bool Status { get; set; }
    public string Message { get; set; }


    public static DashboardResult Success()
    {
        return new DashboardResult() { Status = true,Message = "操作成功" };
    }


    public static DashboardResult Create(bool status)
    {
        return new DashboardResult() { Status = status,Message = "操作成功" };
    }

    public static DashboardResult Create(bool status, string message)
    {
        return new DashboardResult() { Status = status, Message = message };
    }
}

public class DashboardResult<T> : DashboardResult
{
    public T Data { get; set; }

    public static DashboardResult<T> Create(T data)
    {
        return new DashboardResult<T>() { Data = data, Status = true,Message = "操作成功"};
    }
}

public class DashboardPageResult<T> : DashboardResult<T>
{
    public int Total { get; set; }

    public static DashboardResult<List<T>> Create(List<T> data, int total)
    {
        return new DashboardPageResult<List<T>>() { Data = data, Status = true, Total = total };
    }
}